package me.ingxin.android.permission2.ext

import android.content.Context
import android.content.Intent
import android.os.Build
import android.provider.Settings
import androidx.annotation.ChecksSdkIntAtLeast
import androidx.annotation.RequiresApi
import me.ingxin.android.permission2.PERMISSION_MANAGE_EXTERNAL_STORAGE

/**
 * Created on 2023/7/16 by yin
 */
internal class ManageExternalStoragePermissionTask : BaseSpecialPermissionsTask() {
    override val permission = PERMISSION_MANAGE_EXTERNAL_STORAGE

    @ChecksSdkIntAtLeast(api = Build.VERSION_CODES.R)
    override fun showRequestPermission(context: Context): Boolean {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
    }

    @RequiresApi(Build.VERSION_CODES.R)
    override fun crateInput(context: Context): Intent {
        return Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)
    }
}